/* ====================
来源：guangtou.me
作者：光头obsidian教程
功能：为代码块增加行号显示。
==================== */

.HyperMD-codeblock-begin {
  counter-reset: line-numbers;
  text-indent: 0 !important; 
}

.HyperMD-codeblock.cm-line:not(.HyperMD-codeblock-begin):not(.HyperMD-codeblock-end) {
  padding-left: 3.5em; 
  position: relative;
  text-indent: 2em; 
}

.HyperMD-codeblock.cm-line:not(.HyperMD-codeblock-begin):not(.HyperMD-codeblock-end)::after {
  align-items: flex-start;
  color: var(--text-faint);
  content: counter(line-numbers);
  counter-increment: line-numbers;
  display: flex;
  font-size: 0.8em;
  height: 100%;
  justify-content: flex-end;
  left: 0;
  position: absolute;
  text-align: right;
  width: 2em; 
  padding-right: 0.5em;
  bottom: -2px;
  border-right: 1px solid var(--scrollbar-thumb-bg);
  white-space: nowrap;
}

.HyperMD-codeblock.cm-line.cm-active:not(.HyperMD-codeblock-begin):not(.HyperMD-codeblock-end)::after {
  color: var(--color-accent);
}

.HyperMD-codeblock.cm-line.HyperMD-codeblock-end {
  text-indent: 0 !important; 
}

.HyperMD-codeblock .cm-foldPlaceholder::before {
  display: none;
}